class LangUtils{

    /**
     * 获取文字内容 根据id
     */
    public static getText(id:number):string{
        var info:data.HomePage = LocalData.getHomePageByID_HomePage(id);
        if(Global.LANGUAGE == LanguageType.CHINESE){
            return info.Desc;
        }else{
            return info.Desc2;
        }
    }

    /**
     * 检测系统语言
     */
    public static checkSystemLang():void{
        var languageIndex = CookieUtils.getLanguage();
        var language:string;
        //检测 cookie语言
        if(languageIndex == 0){
            language = navigator.language;
            if(language.indexOf('zh') > -1){
                Global.LANGUAGE = LanguageType.CHINESE;
            }else{
                Global.LANGUAGE = LanguageType.ENGLISH;
            }
        }else{
            Global.LANGUAGE = languageIndex;
        }
    }

    /**
     * 根据语言设置skin
     */
    public static setSkin(disply:any):void{
        var url:string = disply.name;
        if(Global.LANGUAGE == LanguageType.ENGLISH){
            url = url.replace("cn/","en/");
        }
        disply.skin = url;
    }
}